package com.cherish.pattern.factory.simplef;

import com.cherish.pattern.factory.model.HP;
import com.cherish.pattern.factory.model.Laptop;
import com.cherish.pattern.factory.model.Lenovo;
import com.cherish.pattern.factory.model.MAC;

/**
 * @Classname SimpleLaptopFactory
 * @Date 2019/4/7 11:09
 * @Author admin
 * @Description TODO
 */
public class SimpleLaptopFactory {

    Laptop getLaptop(String brand) {
        if ("HP".equals(brand)) {
            return new HP();
        } else if ("Lenovo".equals(brand)) {
            return new Lenovo();
        } else if ("MAC".equals(brand)) {
            return new MAC();
        } else {
            return null;
        }
    }

}
